package com.Stream;

import java.util.ArrayList;
import java.util.HashMap;

public class StreamDemo01 {
    public static void main(String[] args) {
        //method1();
        //method2();
        //method3();

    }

    private static void method3() {
        HashMap<String,Integer> hm=new HashMap<>();
        hm.put("张三",21);
        hm.put("李四",23);
        hm.put("王五",25);
        hm.entrySet().stream().forEach(s -> System.out.println(s));
    }

    private static void method2() {
        HashMap<String,Integer> hm=new HashMap<>();
        hm.put("张三",21);
        hm.put("李四",23);
        hm.put("王五",25);
        hm.keySet().stream().forEach(s -> System.out.println(s));
    }

    private static void method1() {
        ArrayList<String> list=new ArrayList<>();
        list.add("aaa");
        list.add("bbb");
        list.add("ccc");
        list.stream().forEach(s-> System.out.println(s));
    }
}
